package com.atguigu.executorpool;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * @program: IDEAcode
 * @description:重头戏
 * @author: Mr.zjx
 * create: 2021-07-31-19-03
 **/
public class addCollection {
    public static void main(String[] args) {
        Collection<String> coll = new ArrayList<String>();
        coll.add("c++");
        coll.add("java");
        coll.add("php");
        System.out.println("coll = " + coll);
        Iterator<String> it = coll.iterator();//迭代器取出
        while (it.hasNext()){
            System.out.println(it.next());
        }
    }
}
